<?php
include_once("../../includes/config.inc.php");
check_login();
$suserSession=get_suser();
$customer_id=$suserSession['id'];
$Customer_Config = new Model_CustomerConfig();

$row = $Customer_Config->fetchRow("select * from customer_config where customer_id='{$customer_id}'");
if($row['id']){
    $Customer_Config->updateById($row['id'],array('customer_id'=>$customer_id,'appid'=>$_POST['app_id'],'appsecret'=>$_POST['app_Secret']));
}else{
    $Customer_Config->insert(array('customer_id'=>$customer_id,'appid'=>$_POST['app_id'],'appsecret'=>$_POST['app_Secret']));
}

die('success');
?>